php forum
php mysql forum
php mysql smarty
 
Topic Options
#280434 - 10/05/04 12:05 PM Beta-[6.5] Randon Tips for IIP
Basil Fawlty Offline
Journeyman

Registered: 10/30/01
Posts: 135
Loc: New Mexico
Mod Name / Version: Randon Tips for IIP <br /><br />Description: Not sure this is really a "Mod" but I use IIP 6.5 and made one of my custom PAL boxes into a "Random Tip" generator. Each time a user hits the Entrance Page, that box pulls a random "forum tip" from a DB table and displays it. [Moderator, if this is not appropriate here, please delete]<br />Can bee seen at www.Britishcarforum.com<br /><br />NOTE: I happen to use this for random forum tips (how to do things on the forum) but it could be used to display any random text you want.<br /><br /> <br /><br />Working Under: UBB.Threads 6.5 <br /><br />Mod Status: Beta <br /><br />Any pre-requisites: Threads 6.5 and IIP 6.5 (Probably would work with other versions) <br /><br />Author(s): Basil <br /><br />Date: 10/05/04 <br /><br />Credits: Obviously David Lozier for the great IIP Mod and others who have improved on it <br /><br />Files Altered: Custombox8pal.php (or any custom PAL box) <br /><br />New Files: None <br /><br />Database Altered: Threads <br /><br />Info/Instructions: Add a Table w3t_IIPrandomtip to the threads data base. The table just needs two fields:<br /><br />tipnumber, type=int autoindex<br />tiptext, type=text<br /><br />Just add a row for each random tip (or whatever) you want. The text in the tiptext field can contain standard HTML code.<br /><br />Then just modify one of your custom PAL box files like so:<br /><br />
Code:
<br />// MODE BY BASIL TO MAKE CONTENT RANDOM:<br /><br />	$query = "SELECT * FROM w3t_IIPrandomtip";<br />	$result = mysql_query($query);<br />	$num_results = mysql_num_rows($result);<br />	$tipnumber=rand(1,$num_results);<br /><br />	// Get the random tip text<br />	$query = "SELECT * FROM w3t_IIPrandomtip WHERE tipnumber = $tipnumber";<br />	$result = mysql_query($query);<br />	$row = mysql_fetch_row($result);<br />	$tip = $row[1];<br />		<br />	echo "$tbopen&lt;tr&gt;&lt;td align=\"left\" class=\"tdheader\"&gt;"; // Table Start<br />	<br />	echo "Random Forum Tip #".$tipnumber; // Table Heading<br />	<br />	echo "&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align=\"left\" valign=\"top\" class=\"lighttable\"&gt;"; // Close Header and Open Content<br /><br />	echo $tip;<br /><br />	echo "&lt;/td&gt;&lt;/tr&gt;$tbclose&lt;br /&gt;"; // Close Content and End Table<br />
<br /><br /> <br /><br />Disclaimer: Please backup every file that you intend to modify. <br />If the modification modifies the database, it's a good idea to backup your database before doing so. <br /><br />Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.

Top
#280435 - 10/06/04 10:00 PM Re: Beta-[6.5] Randon Tips for IIP [Re: BBCG]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
Cool, would be useful for a 'quote of the day' box too <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />
_________________________
- Allen wavey
- What Drives You?

Top



Moderator:  Ian_W 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks